<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">
      

<ui:composition template="/Template.xhtml">

<ui:define name="menu">
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
		<tr height="20">
			<td background="./Images/menu_hg.jpg" width="22" />
			<td background="./Images/menu_h.jpg" width="100" />
			<td background="./Images/menu_hm00.jpg" width="40" />
			<td background="./Images/menu_h.jpg" width="190" />
			<td background="./Images/menu_hd.jpg" width="21" />
			<td width="164"/>
			<td background="./Images/hg.jpg" width="22" />
			<td background="./Images/h.jpg" width="105" />
			<td background="./Images/menu_hm10.jpg" width="40" />
			<td background="./Images/menu_h.jpg" width="130" />
			<td background="./Images/menu_hm00.jpg" width="40" />
			<td background="./Images/menu_h.jpg" width="105" />
			<td background="./Images/menu_hd.jpg" width="21" />
		</tr>
		<tr height="35">
			<td background="./Images/menu_g.jpg" width="22" />
			<td bgcolor="#C7AFBD" valign="top" align="center" width="110">
				<a class="menu" href="./AnnoncesRecherche.jsf">Les annonces</a>
			</td>
			<td background="./Images/menu_m00.jpg" width="40" />
			<td bgcolor="#C7AFBD" valign="top" align="center" width="140">
				<h:form>
				<h:commandLink class="menu" value="Passer une annonce" action="CompteLogin" rendered="#{!compteLogin.connecte}">
					<f:setPropertyActionListener target="#{compteLogin.page}" value="1" />
				</h:commandLink>
				<h:panelGroup rendered="#{compteLogin.connecte}">
							<h:commandLink class="menu" value="Passer une annonce" action="#{AnnoncesSession.gotoNouvellep}" rendered="#{!compteLogin.corp}" />
							<h:commandLink class="menu" value="Passer une annonce" action="#{AnnoncesSession.gotoNouvellec}" rendered="#{compteLogin.corp}" />
				</h:panelGroup>
				</h:form>
			</td>
			<td background="./Images/menu_d.jpg" width="21" />
			<td />
			<td background="./Images/g.jpg" width="22" />
			<td bgcolor="#F8F2DA" valign="top" align="center" width="100">
				<h:form>
				<h:commandLink class="menuselect" value="Mes favoris" action="CompteLogin" rendered="#{!compteLogin.connecte}">
					<f:setPropertyActionListener target="#{compteLogin.page}" value="2" />
				</h:commandLink>
				<h:panelGroup rendered="#{compteLogin.connecte}">
					<h:commandLink class="menuselect" value="Mes favoris" action="AnnoncesProprietaireFavorites" rendered="#{!compteLogin.corp}" />
					<h:commandLink class="menuselect" value="Mes favoris" action="AnnoncesChercheurFavorites" rendered="#{compteLogin.corp}" />
				</h:panelGroup>
				</h:form>
			</td>
			<td background="./Images/menu_m10.jpg" width="40" />
			<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
				<h:form>
				<h:commandLink class="menu" value="Mes annonces" action="CompteLogin" rendered="#{!compteLogin.connecte}">
					<f:setPropertyActionListener target="#{compteLogin.page}" value="3" />
				</h:commandLink>
				<h:panelGroup rendered="#{compteLogin.connecte}">
					<h:commandLink class="menu" value="Mes annonces" action="AnnoncesProprietairePerso" rendered="#{!compteLogin.corp}" />
					<h:commandLink class="menu" value="Mes annonces" action="AnnoncesChercheurPerso" rendered="#{compteLogin.corp}" />
				</h:panelGroup>
				</h:form>
			</td>
			<td background="./Images/menu_m00.jpg" width="40" />
			<td bgcolor="#C7AFBD" valign="top" align="center" width="100">
				<h:form>
				<h:commandLink class="menu" value="Mon panier" action="CompteLogin" rendered="#{!compteLogin.connecte}">
					<f:setPropertyActionListener target="#{compteLogin.page}" value="4" />
				</h:commandLink>
				<h:commandLink class="menu" value="Mon panier" action="Panier" rendered="#{compteLogin.connecte}" />
				</h:form>
			</td>
			<td background="./Images/menu_d.jpg" width="21" />
		</tr>
		<tr height="20">
			<td background="./Images/menu_bg.jpg" width="22" />
			<td background="./Images/menu_b.jpg" />
			<td background="./Images/menu_bm00.jpg" width="40" />
			<td background="./Images/menu_b.jpg" />
			<td background="./Images/menu_mg.jpg" width="21" /> 
			<td background="./Images/h.jpg"/>
			<td background="./Images/menu_md1.jpg" width="22" />
			<td bgcolor="#F8F2DA" />
			<td background="./Images/menu_bm10.jpg" width="40" />
			<td background="./Images/menu_b.jpg" />
			<td background="./Images/menu_bm00.jpg" width="40" />
			<td background="./Images/menu_b.jpg" />
			<td background="./Images/menu_bd.jpg" width="21" />
		</tr>
	</table>
</ui:define>

<ui:define name="page">
	<h1>Gestion de mes favoris</h1>
 		<h:dataTable value="#{compteLogin.comptechercheuractif.mesFavoris}" var="annoncec" id="Tchercheur" cellspacing="0" width="850">
		  <h:column width="120">
		    <f:facet name="header"><div style="max-width:120px;min-width:120px;">Photo</div></f:facet>
		    <h:graphicImage value="#{annoncec.annonceentity.photo}" width="100" />
		  </h:column>
 	    <h:column width="80">
 	  		<center>
		    <f:facet name="header"><div style="max-width:80px;min-width:80px;">Date de parution</div></f:facet>
		    #{annoncec.annonceentity.date}
		    </center>
		  </h:column>
 	      <h:column width="25">
 	  		<div style="max-width:25px;min-width:25px;"></div>
		  </h:column>
		  <h:column width="450">
		    <center>
		    <f:facet name="header"><div style="max-width:450px;min-width:450px;">Titre</div></f:facet>
		    </center>
		    <b><a href="AnnoncesProprietaireDetails.jsf?apid=#{annoncec.id}">#{annoncec.annonceentity.titre}</a></b>
		    <br/>&nbsp;&nbsp;&nbsp;&nbsp;- Ville : #{annoncec.annonceentity.ville}
		    <br/>&nbsp;&nbsp;&nbsp;&nbsp;- Surface : #{annoncec.surface}
		    <br/>&nbsp;&nbsp;&nbsp;&nbsp;- Loyer : #{annoncec.loyer}
		    
		  </h:column>
		  <h:column width="120">
		    <div align="right" style="max-width:120px;min-width:120px;">
			<h:form>			 	
				<a href="AnnoncesProprietaireDetails.jsf?apid=#{annoncec.id}">En savoir plus</a>
		    	<br /><br />
				<h:commandLink value="Supprimer" action="#{Annonces.deleteFavorip}">
				    <f:setPropertyActionListener target="#{Annonces.actionid}" value="#{annoncec.id}" />
				</h:commandLink>
		    </h:form>
		    </div>
		  </h:column>
		</h:dataTable>
</ui:define>
</ui:composition>
</html>